<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<html>
<head>
	<title>业务处理-采购管理-待采购物资</title>
	<meta charset="utf-8">
	<link rel="stylesheet" type="text/css" href="<%=basePath %>libs/bootstrap-3.3.7-dist/css/bootstrap.min.css">
	<link rel="stylesheet" type="text/css" href="<%=basePath %>css/reset.css">
	<link rel="stylesheet" type="text/css" href="<%=basePath %>css/style.css">
	<link rel="stylesheet" type="text/css" href="<%=basePath %>css/iframe.css">
</head>
<body>
	<div id="mainContent">
		<div id="mainContent_content">
			<div class="page_header"><a>待采购物资</a></div>
			<div class="search">
			<form action="<%=basePath %>purchaseAgent/listPurchaseAgent.do" method="post" class="form">
				<input type="hidden" name="currentPage" value="1">
				<p>
					<label>申请单号</label>
					<input type="text" class="form-control" name="applicationNo" value="${purchaseAgentPage.applicationNo }"></input>
					<label>时间</label>
					<input type="text" class="form-control" name="submitTime1" value="${purchaseAgentPage.submitTime1 }" readonly onclick="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd'})"></input>
					<label class="dateSpan">至</label>
					<input type="text" class="form-control" name="submitTime2" value="${purchaseAgentPage.submitTime2 }" readonly onclick="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd'})"></input>
					<label>部门</label>
					<select name="deptID" class="form-control select">
						<option value="">全部</option>
						<c:forEach items="${organizations }" var="org">
							<option value="${org.organizationid }" <c:if test="${purchaseAgentPage.deptID==org.organizationid}">selected</c:if>>${org.organizationname }</option>
						</c:forEach>
					</select>
					<label>邮轮</label>
					<select name="cruiseID" class="form-control select">
						<option value="">全部</option>
						<c:forEach items="${cruiseList }" var="cruise">
							<option value="${cruise.cruiseID }" <c:if test="${purchaseAgentPage.cruiseID==cruise.cruiseID}">selected</c:if>>${cruise.cruiseName }</option>
						</c:forEach>
					</select>
				</p>
				<p>
					<label>物料类型</label>
					<select name="materialMaterial" class="form-control select">
						<option value="">全部</option>
						<option value="普通物料" <c:if test="${purchaseAgentPage.materialMaterial=='普通物料'}">selected</c:if>>普通物料</option>
						<option value="IMPA物料" <c:if test="${purchaseAgentPage.materialMaterial=='IMPA物料'}">selected</c:if>>IMPA物料</option>	
					</select>
					<%-- <label>说明</label>
					<input type="text" class="form-control" class="doubleWidth" name="explains" value="${purchaseAgentPage.explains }"></input> --%>
					<label>提交人</label>
					<input type="text" class="form-control" name="commitName" value="${purchaseAgentPage.commitName }"></input>
					<span class="btn">
						<input type="submit" value="搜索" class="btn btn1"></input>
						<c:if test="${isAddPurchaseOrder }">
						<input type="button" value="生成订购单" class="btn btn2" onclick="location.href='<%=basePath %>purchaseAgent/toAddPurchaseOrder.do'"></input>
						</c:if>
						<input type="button" class="btn btn1" value="下载PDF" onclick="window.open('<%=basePath %>purchaseAgent/download.do?purchaseRequisitionID=${pur.purchaseRequisitionID }');"></input>
						<input type="button" class="btn btn2" value="导出Excel" onclick="window.open('<%=basePath %>purchaseAgent/downloadExcel.do?purchaseRequisitionID=${pur.purchaseRequisitionID }');"></input>
					</span>
				</p>
			</form>
			</div>
			<div class="tableBox box">
				<table class="table table-bordered table_text_center">
					<thead>
						<tr>
							<th>申请单号</th>
							<th>物品编码</th>
							<th>物品名称</th>
							<th>数量</th>
							<th>单位</th>
							<th>品牌</th>
							<th>所属分类</th>
							<th>物料类型</th>
							<th>申请时间</th>
							<th>申请人</th>
							<th>所属部门</th>
							<th>所属邮轮</th>
						</tr>
					</thead>
					<tbody>
						<c:forEach items="${itemList }" var="item">
							<tr>
								<td>${item.applicationNo }</td>
								<td>${item.itemCode }</td>
								<td>${item.chineseName }</td>
								<td>${item.number }</td>
								<td>${item.salesUnit }</td>
								<td>${item.brand }</td>
								<td>${item.categoryName }</td>
								<td>${item.materialMaterial }</td>
								<td><fmt:formatDate value='${item.createDate }' type='date'/></td>
								<td>${item.commitName }</td>
								<td>${item.organizationName }</td>
								<td>${item.cruiseName }</td>
							</tr>
						</c:forEach>
					</tbody>
				</table>
			</div>
			<jsp:include page="/jsp/basic/page.jsp"></jsp:include>
		</div>
		<jsp:include page="/jsp/basic/prompt.jsp"></jsp:include>
	</div>
	<script src="<%=basePath %>js/jquery-3.2.1.min.js"></script>
	<script src="<%=basePath %>libs/bootstrap-3.3.7-dist/js/bootstrap.js"></script>
	<script src="<%=basePath %>My97DatePickers/WdatePicker.js"></script>
	<script src="<%=basePath %>js/public.js"></script>
</body>
</html>